<?php

namespace app\model;

use think\Model;

class Favorite extends Model
{
    //更改默认自动时间戳字段名
    protected $createTime = 'favorite_time';
    //开启自动时间戳
    protected $autoWriteTimestamp = true;
    //关闭 updateTime字段的自动时间戳
    protected $updateTime = false;

    //通过回收物id 关联回收物模型
    function recyclables()
    {
        return $this->belongsTo(Recyclables::class,'recyclables_id','id');
    }

}